﻿<!-- Le Dictionnaire des ressources définit certains styles globaux de l'application-->
<ResourceDictionary
    x:Class="Wpf3dCollaborative.Style"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
       	 >

    <ControlTemplate x:Key="toggleButtonTemplate" TargetType="ToggleButton">
        <Grid
                        Width="224"
                        Height="117"
                        Background="Transparent">
            <Image x:Name="ExpandImage"
                                  Source="/wpf3dCollaborative;component/Images/kinect.png"
                                  HorizontalAlignment="Left" 
                                  VerticalAlignment="Center" 
                                  Margin="1,1,1,1" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked"
                     Value="True">
                <Setter Property="Source"
                              TargetName="ExpandImage"
                                  Value="../../Images/kinectEnabled.png"/>
            </Trigger>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter Property="Source"
                              TargetName="ExpandImage"
                                  Value="../../Images/kinectDisabled.png"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="toggleButtonStyle" TargetType="ToggleButton">
        <Setter Property="Template" Value="{StaticResource toggleButtonTemplate}" />
    </Style>

    <ControlTemplate x:Key="BoutonRond"  TargetType="{x:Type Button}">
        <ControlTemplate.Resources>
            <Storyboard x:Key="Timeline1">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Timeline2">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.4"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </ControlTemplate.Resources>


        <Grid>

            <Border Opacity="0.4" HorizontalAlignment="Stretch" x:Name="glow" Width="Auto" Background="LightGray" />


            <TextBlock  FontFamily="Arial" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" > 
                        
                        <ContentPresenter   Width="Auto" >
                           
                        </ContentPresenter>
            </TextBlock>

        </Grid>


        <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Visibility" TargetName="glow" Value="Hidden"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource Timeline1}"/>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard x:Name="Timeline2_BeginStoryboard" Storyboard="{StaticResource Timeline2}"/>
                </Trigger.ExitActions>
            </Trigger>

            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity"  Value="0.2"/>


            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>


    <Style TargetType="{x:Type ComboBoxItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                    <Grid SnapsToDevicePixels="true">
                        <Border x:Name="Border"  />
                        <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="3,0,0,0"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter Property="Background" TargetName="Border" Value="#FF79E289"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>